package java_methods.constructor_method;

public class Point4 {
	int x,y;
	
	Point4() {
	}
	Point4(int x, int y){
		this.x = x;
		this.y = y;
	}
	
	void setX(int x) {
		this.x = x;
	}
	
	void setY(int y) {
		this.y = y;
	}
	
	void setPoint(int x, int y){
		this.x = x;
		this.y = y;
	}
	public static void main(String[] args) {
		// All below definitions Creates a Point ( x=10, y=20 )
		Point4 p1 = new Point4();
		p1.setX(10);
		p1.setY(20);
		p1.print();
		
		Point4 p2 = new Point4();
		p2.setPoint(10,20);
		p2.print();
		
		Point4 p3 = new Point4(10,20);
		p3.print();
	}
	
	void print(){
		System.out.println("Point : " + x + " , " + y);
	}

}
